import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class MyBookReviewItemSkeleton extends StatelessWidget {
  const MyBookReviewItemSkeleton({super.key});

  @override
  Widget build(BuildContext context) {
    final Widget line = Container(
      width: double.infinity,
      height: 15,
      decoration: BoxDecoration(
        borderRadius: BorderRadius.circular(5),
        color: Theme.of(context).colorScheme.inverseSurface,
      ),
    );
    final Widget shortLine = Container(
      width: 100.w,
      height: 15,
      decoration: BoxDecoration(
        borderRadius: BorderRadius.circular(5),
        color: Theme.of(context).colorScheme.inverseSurface,
      ),
    );

    final Widget iconStar = Icon(
      Icons.star,
      color: Theme.of(context).colorScheme.inverseSurface,
      size: 16.r,
    );
    return Padding(
      padding: EdgeInsets.only(bottom: 20.h),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          // 读者信息
          Row(
            children: [
              // 头像
              Container(
                height: 40.r,
                width: 40.r,
                decoration: BoxDecoration(
                  shape: BoxShape.circle,
                  color: Theme.of(context).colorScheme.inverseSurface,
                ),
              ),

              15.horizontalSpace,
              // 读者信息
              Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Container(
                    height: 16.r,
                    width: 60.r,
                    decoration: BoxDecoration(
                      borderRadius: BorderRadius.circular(5),
                      color: Theme.of(context).colorScheme.inverseSurface,
                    ),
                  ),
                  SizedBox(
                    width: 80.w,
                    height: 20.h,
                    child: Row(
                      children: List.generate(5, (_) {
                        return iconStar;
                      }),
                    ),
                  )
                ],
              ),
            ],
          ),

          10.verticalSpace,

          // 读者评论
          Column(
            children: List.generate(5, (index) {
              return Padding(
                padding: EdgeInsets.only(bottom: 8.h),
                child: line,
              );
            }),
          ),
          shortLine
        ],
      ),
    );
  }
}
